﻿using Tfs.OnTheRoad.Model;
namespace Tfs.OnTheRoad.ViewModel
{
    /// <summary>
    /// Changes ViewModel
    /// </summary>
    public class ChangeListViewModel : BaseListViewModel<Change>
    {     
        private Changeset _currentChangeset;

        public Changeset CurrentChangeset
        {
            get { return _currentChangeset; }
            set { _currentChangeset = value; }
        }


        public ChangeListViewModel(Model.Changeset changeset)
            : base()
        {
            _currentChangeset = changeset;
            PageTitle = "Changesets";
            OrderBy = "Path asc";
        }

        public ChangeListViewModel(string path)
            : base(path)
        {
        }

        public override string GetNoResultsFoundMessage()
        {
            return "No changes were found.";
        }
        
        public override string GetEntityCollectionName()
        {
            return string.Format("Changesets({0})/Changes", _currentChangeset.Id); 
        }
    }
}
